﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="Stylesheet" href="Content/css/style.css" />
    <script src="Content/Scripts/jquery-1.10.2.js"></script>
    <script src="GeneralScripts/Main.js"></script>
</head>
<body>
    <form id="form1" runat="server" onsubmit="return checkform();">
    <div class="section">
        <div style="margin-left: 500px; margin-top: 200px">
            <table>
                <tr>
                    <td>
                        User Name:
                    </td>
                    <td>
                        <asp:TextBox ID="txtuserName" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        <a id="usrError" class="error">Lütfen kullanıcı adınızı giriniz.</a>
                    </td>
                </tr>
                <tr>
                    <td>
                        Password:
                    </td>
                    <td>
                        <asp:TextBox ID="txtPasword" TextMode="Password" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        <a id="passError" class="error">Lütfen şifrenizi giriniz.</a>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp
                    </td>
                    <td>
                        <asp:Button ID="login" runat="server" Text="Login" OnClick="Login_ButtonClick" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    </form>
    <script type="text/javascript">
        function checkform() {
            var userName = $('#<%=txtuserName.ClientID%>').val();
            var password = $('#<%=txtPasword.ClientID%>').val();

            if (userName == '' && password == '') {
                ShowValidationMessage($('#usrError'));
                ShowValidationMessage($('#passError'));
                return false;
            }
            else if (userName == '') {
                ShowValidationMessage($('#usrError'));
                HideValidationMessage($('#passError'));
                return false;
            }
            else if (password == '') {
                ShowValidationMessage($('#passError'));
                HideValidationMessage($('#usrError'));
                return false;
            }
            return true;
        }

    </script>
</body>
</html>
